home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / program / wx_lib10.zoo / wx_outst.c < prev    next >
C/C++ Source or Header  |  1992-08-02  |  1KB  |  49 lines

  1. #include <wx_lib.h>
  2.  
  3. void    wx_outstr(ws,sp)
  4. Window    *ws;
  5. char    *sp;
  6. {
  7.     int        array[4],
  8.             xpixel,
  9.             ypixel;
  10.     
  11.     /*
  12.      * If we're on the last line, scroll the window display
  13.      */
  14.     if (ws->ypos >= ws->maxy) {
  15.         wx_fscroll(ws);
  16.     }
  17.  
  18.     /*
  19.      * Compute our actual position based on the offset into the bitmap (based
  20.      * on the work positions) plus our character positions times their 
  21.      * extents.
  22.      */
  23.     xpixel = ws->work.g_x + (ws->xpos * ws->wchr);
  24.     ypixel = ws->work.g_y + (ws->ypos * ws->hchr);
  25.  
  26.     /*
  27.      * Write the text
  28.      */
  29.     graf_mouse(M_OFF,NULL);
  30.     v_gtext(ws->vdih,xpixel,ypixel,sp);
  31.  
  32.     /*
  33.      * Clear to EOL.
  34.      * The upper left corner is the end of the string v. the y value of the
  35.      * string position.
  36.      */
  37.     array[0] = xpixel + (strlen(sp) * ws->wchr);
  38.     array[1] = ypixel;
  39.     array[2] = ws->work.g_x + ws->work.g_w - 1;
  40.     array[3] = ypixel + ws->hchr;
  41.     vr_recfl(ws->vdih,array);
  42.     graf_mouse(M_ON,NULL);
  43.  
  44.     /*
  45.      * Move the cursor to the end of the string.
  46.      */
  47.     ws->xpos += strlen(sp);
  48. }
  49.